Main content
Unit 3: Simulating phenomena with loops
About this unit
How can you use computers to predict outcomes that are too big for humans to calculate? Discover repetition with while loops and for loops with range. Learn how to simulate events over time by setting up experiments with randomness and repeating them with loops.
Why reinvent the wheel when you can import wheel?
Control flow isn't always linear. Sometimes, it loops!
Practice
For when you know the number of times you want to repeat.
Practice
Can you terminate a loop under several conditions?
Practice
How can you design an experiment to simulate natural selection?